# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Marcin Kulik <marcin@asciinema.org>

pkgname=asciinema
pkgver=2.2.0
pkgrel=3
pkgdesc='Record and share terminal sessions'
arch=(any)
url='https://asciinema.org/'
license=(GPL3)
depends=(python)
makedepends=(git python-setuptools python-wheel python-build python-installer)
source=('git+https://github.com/asciinema/asciinema#commit=f3af768f569e0b363bcced11d266d4ed857e21e7') # tag: v2.1.0
b2sums=(SKIP)

prepare() {
  echo -e '#!/bin/sh\n/usr/bin/python -m asciinema "$@"' > "$pkgname/asciinema.sh"
}

build() {
  cd $pkgname
  python -m build --wheel --no-isolation
}

package() {
  cd $pkgname
  install -Dm755 -t "$pkgdir/usr/bin" asciinema.sh
  python -m installer --destdir="$pkgdir" dist/*.whl
}

# getver: raw.githubusercontent.com/asciinema/asciinema/master/asciinema/__init__.py
